package com.kongjian.manage.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.kongjian.manage.model.dto.LoginSysUserDTO;
import com.kongjian.manage.model.dto.LoginVerificationSysUserDTO;
import com.kongjian.manage.model.vo.SysUserVO;
import com.kongjian.manage.common.R;
import com.kongjian.manage.model.dto.NewSysUserDTO;
import com.kongjian.manage.model.dto.UpdateSysUserDTO;
import com.kongjian.manage.model.query.SysUserQuery;
import com.kongjian.manage.model.entity.SysUserEntity;

import javax.servlet.http.HttpSession;

/**
* @author tangjunfeng
* @Classname ISysUserService.java
* @Description 用户管理service
* @Date 2023-12-18
* @Version V1.0
*/
public interface ISysUserService extends IService<SysUserEntity> {

    /**
    * 分页查询
    * @param query
    * @return
    */
    R<Page> queryPageSysUser(SysUserQuery query)  throws Exception;


   /**
     * 根据实体查询VO对象
     * @param id ID
     */
    SysUserVO getByIdSysUser(Long id) throws Exception;

   /**
    * 新增
    * @param sysUserDTO DTO
    */
    void addSysUser(NewSysUserDTO sysUserDTO) throws Exception;


   /**
    * 更新
    * @param id ID
    * @param sysUserDTO DTO对象
    */
   void modifySysUser(Long id,UpdateSysUserDTO sysUserDTO) throws Exception;

   /**
    * 根据ID删除
    * @param id ID
    */
   void deleteSysUser(Long id) throws Exception;

   /**
    * 统计
    * @param query 查询实体
    */
   Integer countSysUser(SysUserQuery query);

    /**
     * 登录
     * @param loginSysUserDTO 登录实体
     */
    void login(LoginSysUserDTO loginSysUserDTO);


    /**
     * 签名
     * @param loginSysUserDTO
     */
    void signature(LoginSysUserDTO loginSysUserDTO);

    /**
     * 第一步：签名
     * @param loginSysUserDTO
     */
    String firstSignature(LoginSysUserDTO loginSysUserDTO);

    /**
     * 第二步：签名验签
     *
     * @param loginSysUserDTO
     * @param session
     * @return
     */
    String secondVerification(LoginVerificationSysUserDTO loginSysUserDTO, HttpSession session);
}
